using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Trigger : MonoBehaviour
{
    // Start is called before the first frame update
    public float jtime=0;
    private float m_minTriggerInterval = 0.25f;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (jtime!=0&&Time.time - jtime > m_minTriggerInterval)
        {
            SceneManager.LoadScene("Interface Scene");
        }
    }
    private void OnTriggerStay(Collider other)
    {
        GameObject obj = GameObject.Find("Sphere");
        if (Input.GetKeyDown("Space"))
        {
            if(jtime==0) jtime = Time.time; 

            Debug.Log(obj);
            obj.SetActive(false);
            DataMgr.Instance().f[2]=1;
        }
        
    }
}
